<template>
	<view class="box">
		<view class="main" v-for="item in list" :key="item.id" @click="gonext(item.id)">
			{{item.name}}
			<image :src="baseUrl + '/static/icon/right.png'" mode="aspectFill"></image>
		</view>
	</view>
</template>

<script>
	import { areaByPid} from "../../api/local.js"
	export default{
		data() {
			return {
				baseUrl: this.$imageBaseUrl,
				list:[],
				id:""
				}
		},
		onLoad(e) {
			this.id=e.id
			this.getlist()
		},
		methods:{
			gonext(id){
				uni.navigateTo({
					url:"/pagesMy/groundCat/selarea?id="+id
				})
			},
			getlist(){
				areaByPid(
					{pid:this.id}
				).then(res=>{
					this.list=res.data
				})
			}
		}
		
	}
</script>
<style>
	page{
		background: #fff;
	}
</style>
<style scoped lang="scss">
	.main{
		width: 690rpx;
		height: 80rpx;
		font-size: 32rpx;
		color: #333;
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin: 0 auto;
		padding-left: 30rpx;
		border-bottom: 2rpx solid #f8f8f8;
		>image{
			width: 18rpx;
			height: 26rpx;
		}
	}
</style>